<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>qLibc: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">qLibc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">qLibc Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>qLibc is currently one of the most functionally-complete, publicly-licensed C/C++ libraries. The goal of the qLibc project is to provide a <b>simple and powerful general purpose C/C++ library</b> that includes all kinds of containers and general library routines. It provides a ready-made set of common container APIs with a consistent API look.</p>
<h2>qLibc Copyright</h2>
<p>qLibc is published under 2-clause BSD license known as Simplified BSD License. Please refer the LICENSE document included in the package for more details.</p>
<h2>API Reference</h2>
<ul>
<li><a href="http://wolkykim.github.io/qlibc/doc/html/files.html">qlibc Core API Reference</a><ul>
<li>Containers for Key/Value pairs<ul>
<li>Tree Table &mdash; in binary tree(left-leaning red-black tree) data structure.</li>
<li>Hash Table &mdash; in hash-based data structure.</li>
<li>Static Hash Table &mdash; in fixed size memory(array/mmapped/shared).</li>
<li>List Table &mdash; in (doubly) linked-list data structure.</li>
</ul>
</li>
<li>Containers for Objects<ul>
<li>List &mdash; Doubly Linked List.</li>
<li>Vector &mdash; implements a growable array of elements.</li>
<li>Queue &mdash; FIFO(First In First Out) implementation.</li>
<li>Stack &mdash; LIFO(Last In First Out) implementation.</li>
</ul>
</li>
<li>General utilities.<ul>
<li>String &mdash; string trimmer, modifier, replacer, case converter, pattern detectors, ...</li>
<li>I/O &mdash; non-blcking I/O, stream reader/writer, ...</li>
<li>File &mdash; file locking, file/directory hander, path correctors, ...</li>
<li>IPC, Semaphore Shared-memory</li>
<li>En/decoders &mdash; Url en/decoder, Base64 en/decoder, Hex en/decoder, ...</li>
<li>Hashes &mdash; Murmur hases, FNV hases, MD5 hashes, ...</li>
<li>Time &mdash; time diff, time format converstion, ...</li>
</ul>
</li>
</ul>
</li>
<li><a href="http://wolkykim.github.io/qlibc/doc/html/files.html">qLibc Extension API Reference</a><ul>
<li>Apache-style Configuration File Parser.</li>
<li>INI-style Configuration File Parser.</li>
<li>HTTP client.</li>
<li>Rotating File Logger.</li>
<li>Database(MySQL) interface.</li>
<li><a href="http://en.wikipedia.org/wiki/Token_bucket">Token-Bucket</a></li>
</ul>
</li>
</ul>
<h2>qLibc Tables at a Glance</h2>
<table class="doxtable">
<tr>
<th align="left">Characteristics </th><th align="center">Tree Table </th><th align="center">Hash Table </th><th align="center">Static Hash Table</th><th align="center">List Table  </th></tr>
<tr>
<td align="left">Data structure </td><td align="center">Binary Tree </td><td align="center">Slot Index </td><td align="center">Block Array </td><td align="center">Linked-List </td></tr>
<tr>
<td align="left">Search complexity </td><td align="center">O(log n) </td><td align="center">O(1) / O(n) </td><td align="center">O(1) / O(n) </td><td align="center">O(n) </td></tr>
<tr>
<td align="left">Insert complexity </td><td align="center">O(log n) </td><td align="center">O(1) / O(n) </td><td align="center">O(1) / O(n) </td><td align="center">O(1) </td></tr>
<tr>
<td align="left">Delete complexity </td><td align="center">O(log n) </td><td align="center">O(1) / O(n) </td><td align="center">O(1) / O(n) </td><td align="center">O(n) </td></tr>
<tr>
<td align="left">Space complexity </td><td align="center">O(n) </td><td align="center">O(n) </td><td align="center">- </td><td align="center">O(n) </td></tr>
<tr>
<td align="left">Space allocation </td><td align="center">Dynamic </td><td align="center">Dynamic </td><td align="center">Pre-allocation </td><td align="center">Dynamic </td></tr>
<tr>
<td align="left">Data Stored Sorted </td><td align="center">Yes </td><td align="center">No </td><td align="center">No </td><td align="center">Yes (option) </td></tr>
<tr>
<td align="left">User comparator </td><td align="center">Supported </td><td align="center">- </td><td align="center">- </td><td align="center">Supported </td></tr>
<tr>
<td align="left">Allow multi-keys </td><td align="center">No </td><td align="center">No </td><td align="center">No </td><td align="center">Yes (option) </td></tr>
<tr>
<td align="left">Key stored digested </td><td align="center">No </td><td align="center">No </td><td align="center">Yes </td><td align="center">No </td></tr>
<tr>
<td align="left">Search Nearest Key </td><td align="center">Yes </td><td align="center">No </td><td align="center">No </td><td align="center">No </td></tr>
<tr>
<td align="left">Iterator support </td><td align="center">Yes </td><td align="center">Yes </td><td align="center">Yes </td><td align="center">Yes </td></tr>
<tr>
<td align="left">Iterator visit order</td><td align="center">min -&gt; max </td><td align="center">random </td><td align="center">random </td><td align="center">insert order </td></tr>
<tr>
<td align="left">Thread-safe option </td><td align="center">Supported </td><td align="center">Suported </td><td align="center">No </td><td align="center">Supported </td></tr>
<tr>
<td align="left">Runs on shared mem </td><td align="center">No </td><td align="center">No </td><td align="center">Yes </td><td align="center">No </td></tr>
</table>
<h2>Consistent API Look</h2>
<p>All container APIs have a consistent look and feel. It basically provides a creator function which usually returns a pointer to a container structure. Also, <b>all functions related to the container can be accessed through function pointers inside of the container</b> or traditional style direct access APIs. For an example,</p>
<p>So, regardless of which container you use, you can simply put elements into a list with <code>container-&gt;put(container, ...)</code> or you can call them using direct API like qtreetbl_pub(container, ...).</p>
<p>An examples below illustrates how it looks like.</p>
<div class="fragment"><div class="line"><span class="comment">// create a hash-table.</span></div>
<div class="line">qhashtbl_t *tbl = <a class="code" href="qhashtbl_8c.html#acce512d557a3c776d474bfc977f34045">qhashtbl</a>(0, QHASHTBL_OPT_THREADSAFE);</div>
<div class="line"></div>
<div class="line"><span class="comment">// add an element which key name is &quot;score&quot;.</span></div>
<div class="line"><span class="keywordtype">int</span> x = 12345;</div>
<div class="line">tbl-&gt;put(tbl, <span class="stringliteral">&quot;score&quot;</span>, &amp;x, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
<div class="line"></div>
<div class="line"><span class="comment">// get the value of the element.</span></div>
<div class="line"><span class="keywordtype">int</span> *px = tbl-&gt;get(tbl, <span class="stringliteral">&quot;score&quot;</span>);</div>
<div class="line"><span class="keywordflow">if</span>(px != NULL) {</div>
<div class="line">  printf(<span class="stringliteral">&quot;%d\n&quot;</span>, *px);</div>
<div class="line">  free(px);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">// release table</span></div>
<div class="line">tbl-&gt;free(tbl);</div>
</div><!-- fragment --><p>Here is an identical implementation with a Linked-List-Table container. You may notice that there aren't any code changes at all, except for 1 line in the table creation. This is why qLibc encapsulates corresponding function pointers inside of the container object.</p>
<div class="fragment"><div class="line"><span class="comment">// create a linked-list-table. THE ONLY LINE YOU NEED TO CHANGE.</span></div>
<div class="line">qlisttbl_t *tbl = <a class="code" href="qlisttbl_8c.html#ace8778acce088344531b5249d580aca7">qlisttbl</a>(QLISTTBL_OPT_THREADSAFE);</div>
<div class="line"></div>
<div class="line"><span class="comment">// add an element which key name is &quot;score&quot;.</span></div>
<div class="line"><span class="keywordtype">int</span> x = 12345;</div>
<div class="line">tbl-&gt;put(tbl, <span class="stringliteral">&quot;score&quot;</span>, &amp;x, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
<div class="line"></div>
<div class="line"><span class="comment">// get the value of the element.</span></div>
<div class="line"><span class="keywordtype">int</span> *px = tbl-&gt;get(tbl, <span class="stringliteral">&quot;score&quot;</span>);</div>
<div class="line"><span class="keywordflow">if</span>(px != NULL) {</div>
<div class="line">  printf(<span class="stringliteral">&quot;%d\n&quot;</span>, *px);             </div>
<div class="line">  free(px);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">// release table</span></div>
<div class="line">tbl-&gt;free(tbl);</div>
</div><!-- fragment --><h2>Looking for people to work with.</h2>
<p>We're looking for people who want to work together to develop and improve qLibc. Currently, we have high demands on following areas.</p>
<ul>
<li>Automated testing</li>
<li>Documentation.</li>
<li>New feature implementation.</li>
</ul>
<h2>Contributors</h2>
<p>The following people have helped with suggestions, ideas, code or fixing bugs: (in alphabetical order by first name)</p>
<ul>
<li><a href="https://github.com/alexandrelucchesi">Alexandre Lucchesi</a></li>
<li><a href="https://github.com/darkdh">Anthony Tseng</a></li>
<li>Cesar</li>
<li><a href="https://github.com/colintd">Colin</a></li>
<li><a href="https://github.com/Charles0429">Charles</a></li>
<li><a href="https://github.com/demitsuri">Dmitry Vorobiev</a></li>
<li>HyoSup Woo</li>
<li><a href="https://github.com/netpoetica">Keith Rosenberg</a></li>
<li>Krishna</li>
<li><a href="https://github.com/haveTryTwo">Liu Zhongchao</a></li>
<li>Luis Jimenez</li>
<li>Maik Beckmann</li>
<li>RQ</li>
<li><a href="https://github.com/kirbyfan64">Ryan Gonzalez</a></li>
<li><a href="https://github.com/wolkykim">Seungyoung Kim</a></li>
<li>Umesh</li>
</ul>
<p>If we have forgotten or misspelled your name, please let us know. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
